package org.example;

import java.util.Arrays;
import java.util.Random;

public class FisherYatesTest {
    public static void main(String[] args) {
        Random random = new Random();

        int[] arr = {1,2,3,4,5,6};

        int end = arr.length-1;
        for (int i = end; i > 0; i--) {
             int j = random.nextInt(i+1);
             int temp = arr[i];
             arr[i] = arr[j];
             arr[j] = temp;
        }
        System.out.println(Arrays.toString(arr));
    }
}
